package com.iaiai.browser.core.util;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.widget.Toast;

import com.iaiai.browser.activity.R;

/**
 * 
 * <p>
 * Title: Message.java
 * </p>
 * <p>
 * E-Mail: 176291935@qq.com
 * </p>
 * <p>
 * QQ: 176291935
 * </p>
 * <p>
 * Http: iaiai.iteye.com
 * </p>
 * <p>
 * Create time: 2011-7-14
 * </p>
 * 
 * @author 丸子
 * @version 0.0.1
 */
public class Message {

	public static void showMessage(Activity activity, String message) {
		new AlertDialog.Builder(activity).setPositiveButton(android.R.string.ok, null).setIcon(R.drawable.icon)
				.setTitle("提示").setMessage(message).show();
	}

	public static void showMessage(Activity activity, String message, DialogInterface.OnClickListener onPositiveButton) {
		new AlertDialog.Builder(activity).setPositiveButton(android.R.string.ok, onPositiveButton)
				.setIcon(R.drawable.icon).setTitle("提示").setMessage(message).show();
	}

	public static void showMessage(Activity activity, int message, DialogInterface.OnClickListener onPositiveButton) {
		new AlertDialog.Builder(activity).setPositiveButton(android.R.string.ok, onPositiveButton)
				.setIcon(R.drawable.icon).setTitle("提示").setMessage(message).show();
	}

	public static void showMessage_Yes_Cancel(Activity activity, String message,
			DialogInterface.OnClickListener onPositiveButton) {
		new AlertDialog.Builder(activity).setPositiveButton(android.R.string.ok, onPositiveButton)
				.setNegativeButton(android.R.string.cancel, null).setIcon(R.drawable.icon).setTitle("提示")
				.setMessage(message).show();
	}

	public static void showMessage_Yes_Cancel(Activity activity, String message,
			DialogInterface.OnClickListener onPositiveButton, DialogInterface.OnClickListener onCancelListener) {
		new AlertDialog.Builder(activity).setPositiveButton(android.R.string.ok, onPositiveButton)
				.setNegativeButton(android.R.string.cancel, onCancelListener).setIcon(R.drawable.icon).setTitle("提示")
				.setMessage(message).show();
	}

	public static void showMessage_Yes_Cancel(Activity activity, int message, DialogInterface.OnClickListener onPositiveButton) {
		new AlertDialog.Builder(activity).setPositiveButton(android.R.string.ok, onPositiveButton)
				.setNegativeButton(android.R.string.cancel, null).setIcon(R.drawable.icon).setTitle("提示")
				.setMessage(message).show();
	}

	public static void showMessage_Yes_Cancel(Activity activity, int message,
			DialogInterface.OnClickListener onPositiveButton, DialogInterface.OnClickListener onCancelListener) {
		new AlertDialog.Builder(activity).setPositiveButton(android.R.string.ok, onPositiveButton)
				.setNegativeButton(android.R.string.cancel, onCancelListener).setIcon(R.drawable.icon).setTitle("提示")
				.setMessage(message).show();
	}

	public static void showToast(Activity activity, int message) {
		Toast.makeText(activity, message, Toast.LENGTH_LONG).show();
	}

	public static void showToast(Activity activity, String message) {
		Toast.makeText(activity, message, Toast.LENGTH_LONG).show();
	}

}
